<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>Call Javascript API</title>
  <meta name="apple-mobile-web-app-capable" content="yes" />
  <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  <meta name="apple-touch-fullscreen" content="yes" />
  <meta name="format-detection" content="telephone=no, email=no" />
  <script src="../loader.js"></script>
</head>

<body>
  <h1>Call Javascript API</h1>
  <p>The test result can be found in console.</p>

  <script>
    var importObject = {
      Math,
      objects: {
        count: 666
      },
      methods: {
        output (message) {
          console.log(`-----> ${message} <-----`)
          return message
        }
      }
    }

    loadWebAssembly('./test.wasm', importObject)
      .then(instance => {
        const { test } = instance.exports

        test(666)
      })
  </script>
</body>
</html>
